package com.heima.commnet.controller;


import com.heima.commnet.service.CommentRepayService;
import com.heima.model.comment.dto.CommentRepayDTO;
import com.heima.model.comment.dto.CommentRepayLikeDTO;
import com.heima.model.comment.dto.CommentRepaySaveDTO;

import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/comment_repay")
public class CommentRepayController {

    @Autowired
    private CommentRepayService commentRepayService;

    @PostMapping("/load")
    public ResponseResult loadCommentRepay(@RequestBody CommentRepayDTO dto){
       return commentRepayService.loadCommentRepay(dto);
    }

    @PostMapping("/save")
    public ResponseResult saveCommentRepay(@RequestBody CommentRepaySaveDTO dto){
        return commentRepayService.saveCommentRepay(dto);
    }

    @PostMapping("/like")
    public ResponseResult saveCommentRepayLike(
      @RequestBody CommentRepayLikeDTO dto){
       return commentRepayService.saveCommentRepayLike(dto);
    }

}